//@ sourceURL=TrainPlanTaskForm.js
TrainPlanTaskForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        TrainPlanTaskForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "添加培训任务",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/safecultruetrain/saveTrainPlanTask.do",
                items:[
                {
                    id : "trainPlanTask.id",
                    name : "trainPlanTask.id",
                    xtype : "hidden",
                    value : this.id == null ? "": this.id
                }, {
                    name : "trainPlanTask.years",
                    xtype : "hidden",
                    id : "trainPlanTask.years",
                    value : this.years == null ? "" : this.years
                },{
    				layout : "column",
    				//      border:false,
    				bodyStyle : "padding:5px;",
    				items : [
    						{
    							layout : "form",
    							columnWidth : .5,
    							border : false,
    							//                        True表示为显示出面板body元素的边框，false则隐藏
    							defaultType : "textfield",
    							items : [ {
    								fieldLabel : '任务名称'
    										+ '<font color=red>*</font>',
    								id : "trainPlanTask.taskName",
    								name : "trainPlanTask.taskName",
    								maxLength : 80,
    								width : 146,
    								allowBlank : false,
    								blankText : "任务名称不能为空！"
    							} ]
    						},
    						{
    							layout : "form",
    							border : false,
    							columnWidth : .5,
    							items : [ {
    								//下拉选型设置
    								fieldLabel : "所属机构",
    								hiddenName : "trainPlanTask.institution",
    								xtype : "combo",
    								mode : "local",
    								editable : false,
    								width : 146,
    								triggerAction : "all",
    								store : [
    										[ "1",
    												"组织部" ],
    										[ "2",
    												"财务部" ],
    										[ "3",
    												"销售部" ] ],
    								value : 3
    							} ]
    						},
    						{
    							layout : "form",
    							columnWidth : .5,
    							border : false,
    							//                        True表示为显示出面板body元素的边框，false则隐藏
    							defaultType : "textfield",
    							items : [ {
    								fieldLabel : "任务主题",
    								name : "trainPlanTask.taskTitle",
    								maxLength : 80,
    								width : 146,
    								allowBlank : true
    							} ]
    						},
    						
    						{
    							layout : "form",
    							columnWidth : .5,
    							border : false,
    							//                        True表示为显示出面板body元素的边框，false则隐藏
    							defaultType : "textfield",
    							items : [ {
    								fieldLabel : "培训内容",
    								name : "trainPlanTask.taskContent",
    								maxLength : 80,
    								width : 146,
    								allowBlank : true

    							} ]
    						},
    						{
    							layout : "form",
    							columnWidth : .5,
    							border : false,
    							//                        True表示为显示出面板body元素的边框，false则隐藏
    							defaultType : "textfield",
    							items : [ {
    								fieldLabel : "培训目标",
    								name : "trainPlanTask.taskTarget",
    								maxLength : 80,
    								width : 146,
    								allowBlank : true
    							} ]
    						},
    						{
    							layout : "form",
    							columnWidth : .5,
    							border : false,
    							//                        True表示为显示出面板body元素的边框，false则隐藏
    							defaultType : "textfield",
    							items : [ {
    								fieldLabel : "编制人",
    								name : "trainPlanTask.makeStaff",
    								maxLength : 80,
    								width : 146,
    								allowBlank : true

    							} ]
    						},{
    							layout : "form",
    							columnWidth : .5,
    							border : false,
    							items : [ {
    								xtype : "datefield",
    								fieldLabel : '任务开始时间'
    										+ '<font color=red>*</font>',
    								id : "trainPlanTask.taskBeginDate",
    								format : "y-m-d",
    								name : "trainPlanTask.taskBeginDate",
    								width : 146,
    								allowBlank : false,
    								blankText : "开始时间不能为空！"
    							} ]
    						},{
    							layout : "form",
    							columnWidth : .5,
    							border : false,
    							items : [ {
    								xtype : "datefield",
    								fieldLabel : '任务结束时间'
    										+ '<font color=red>*</font>',
    								id : "trainPlanTask.taskEndDate",
    								format : "y-m-d",
    								name : "trainPlanTask.taskEndDate",
    								width : 146,
    								allowBlank : false,
    								blankText : "结束时间不能为空！"
    							} ]
    						} ]
    			},{
    			layout : "column",
    			bodyStyle : "padding:5px;",
    			items : [
    					{
    						layout : "form",
    						//      border:false,
    						bodyStyle : "padding:5px;",
    						columnWidth : 1.,
    						items : [ {
    							xtype : "textarea",
    							fieldLabel : '任务执行情况',
    							name : 'trainPlanTask.execution',
    							/*maxLength:300,
    							height:25,*/
    							width : 448
    						} ]
    					},
    					{
    						columnWidth : 1.,//第一列 
    						layout : "form",
    						//            border : false,
    						bodyStyle : "padding:5px;",
    						items : [ {
    							xtype : "textarea",
    							fieldLabel : '跟进措施',
    							name : 'trainPlanTask.result',
    							width : 448
    						} ]
    					} ]
    		       }
                   ]
                },
            loadData:{
                getUrl:__ctxPath +"/safecultruetrain/getTrainPlanTask.do",
                preName : "trainPlanTask"
            }
        });
    }
});
